
from PyQt5 import QtCore, QtGui, QtWidgets

class ReaderSpeakerWidget(QtWidgets.QWidget):

    def __init__(self):
        super(ReaderSpeakerWidget, self).__init__()
        self.setupUI()

    def setupUI(self):
        self.gridLayout = QtWidgets.QGridLayout(self)
        self.gridLayout.setObjectName("gridLayout")

        self.bofang = QtWidgets.QPushButton(self.frame_5)
        self.bofang.setMinimumSize(QtCore.QSize(0, 40))
        self.bofang.setMaximumSize(QtCore.QSize(130, 40))
        self.bofang.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.bofang.setStyleSheet("#bofang{\n"
                                  "    background-color:transparent;\n"
                                  "    border-radius:10px;\n"
                                  "border-color:white;\n"
                                  "margin-left:5px;\n"
                                  "color:#3DA19F;\n"
                                  "}")
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap("./imgs/broadcast2.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.bofang.setIcon(icon)
        self.bofang.setIconSize(QtCore.QSize(30, 30))
        self.bofang.setObjectName("bofang")
        self.gridLayout.addWidget(self.bofang, 0, 0, 2, 1)
        self.stop_bofang = QtWidgets.QPushButton(self.frame_5)
        self.stop_bofang.setMinimumSize(QtCore.QSize(0, 20))
        self.stop_bofang.setMaximumSize(QtCore.QSize(100, 40))
        self.stop_bofang.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.stop_bofang.setStyleSheet("#stop_bofang\n"
                                       "{\n"
                                       "    background-color:transparent;\n"
                                       "    border-radius:10px;\n"
                                       "border-color:white\n"
                                       "}")
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap("./imgs/stop.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.stop_bofang.setIcon(icon1)
        self.stop_bofang.setIconSize(QtCore.QSize(20, 20))
        self.stop_bofang.setObjectName("stop_bofang")
        self.gridLayout.addWidget(self.stop_bofang, 0, 2, 1, 1)
        self.rebegin = QtWidgets.QPushButton(self.frame_5)
        self.rebegin.setMinimumSize(QtCore.QSize(0, 20))
        self.rebegin.setMaximumSize(QtCore.QSize(100, 40))
        self.rebegin.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.rebegin.setStyleSheet("#rebegin{\n"
                                   "    background-color:transparent;\n"
                                   "    border-radius:10px;\n"
                                   "border-color:white\n"
                                   "}")
        icon2 = QtGui.QIcon()
        icon2.addPixmap(QtGui.QPixmap("./imgs/rebegin.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.rebegin.setIcon(icon2)
        self.rebegin.setIconSize(QtCore.QSize(22, 22))
        self.rebegin.setObjectName("rebegin")
        self.gridLayout.addWidget(self.rebegin, 1, 2, 1, 1)

        self.retranslateUi()

    def retranslateUi(self):
            _translate = QtCore.QCoreApplication.translate
            self.bofang.setText(_translate("self", "播放题目"))
            self.stop_bofang.setText(_translate("self", "暂停播放"))
            self.rebegin.setText(_translate("self", "重新播放"))
